package com.chixing.day07_abstract;
/*
    1.Account作为父类：SavingAccount与CreditAccount有共同的属性和方法，所以将公共部分 抽离出来
                      放到另一个类中，减少了代码的【冗余性】
    Account acc = new Account(); error
    Account acc = new SavingAccount();
*/
public abstract class Account {
    //存款
    public abstract void depoist();
    //取款
    public void withdraw(){}

}
class SavingAccount extends Account{

    @Override
    public void depoist() {

    }
}

class CreditAccount extends Account{

    @Override
    public void depoist() {

    }
}

class LoantAccount extends Account{ //贷款账户
    @Override
    public void depoist() {

    }
}
